//
//  FactoryDemo.m
//  设计模式
//
//  Created by huyang on 2020/7/3.
//  Copyright © 2020 test. All rights reserved.
//

#import "FactoryDemo.h"
#import "Car.h"
#import "SUVCarFactory.h"
#import "JeepCarFactory.h"
#import "BigCarFactory.h"

@interface FactoryDemo ()
@property (weak, nonatomic) IBOutlet UILabel *ck;

@end

@implementation FactoryDemo

- (void)viewDidLoad {
    [super viewDidLoad];
}


- (IBAction)CJeep:(id)sender {
    Car *car = [JeepCarFactory creatCar];
    NSString *carStr = [car getCar];
    _ck.text = [_ck.text stringByAppendingFormat:@"\n%@",carStr];
}
- (IBAction)CSUV:(id)sender {
    Car *car = [SUVCarFactory creatCar];
    NSString *carStr = [car getCar];
    _ck.text = [_ck.text stringByAppendingFormat:@"\n%@",carStr];
}
- (IBAction)CBig:(id)sender {
    Car *car = [BigCarFactory creatCar];
    NSString *carStr = [car getCar];
    _ck.text = [_ck.text stringByAppendingFormat:@"\n%@",carStr];
}



@end
